package com.mdxx.redis;


import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisFactory {

	private static JedisPool pool;
	
	static{
		//3000是读取超时时间
		JedisPoolConfig config = new JedisPoolConfig();
		config.setMaxTotal(100);
		config.setMaxWaitMillis(3000);
		pool = new JedisPool(config, "122.191.254.42", 6379,3000 , "jjhxc1234");
	}
	
	public static Jedis get(){
		return pool.getResource();
	}
	
	public static void close(){
		pool.close();
	}
}
